# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=asuran-cli
pkgver=0.1.6
pkgrel=0
pkgdesc="Asuran is a new archive format and rust implementation"
url="https://gitlab.com/asuran-rs/asuran"
arch="all !s390x !mips !mips64 !ppc64le" #ppc64le takes too long to build
license="BSD-2-Clause-Patent"
makedepends="cargo openssl-dev"
source="https://gitlab.com/asuran-rs/asuran/-/archive/v$pkgver/asuran-v$pkgver.tar.gz"
builddir="$srcdir/asuran-v$pkgver"

build() {
	local _rf=
	local _f=
	case "$CARCH" in
		x86_64)	  _rf="-C target-feature=+aes $_rf" ;;
		aarch64*) _rf="-C target-feature=+aes $_rf"
			  _f="--features blake3-neon" ;;
	esac

	export RUSTFLAGS=$_rf

	cd asuran-cli
	cargo build --release --locked --verbose $_f
}

check() {
	cargo test all --release --locked --verbose
}

package() {
	install -Dm0755 target/release/asuran-cli "$pkgdir"/usr/bin/asuran-cli
}

sha512sums="2345b9ad0daedc4b21707bcdae72f7678f8e8d7adb470f78088ceb88f8ca18d1661bc5126d6199d5e904b528c7b5b50e9f8c3d770b28b72fcad64c17e9b87add  asuran-v0.1.6.tar.gz"
